import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-myc08-ngmodel',
  templateUrl: './myc08-ngmodel.component.html',
  styleUrls: ['./myc08-ngmodel.component.css']
})
export class Myc08NgmodelComponent implements OnInit {

  uname = 'bingbing'
  upwd: any = '';
  msg: any = '密码长度在6~12位之间';

  constructor() {
  }

  ngOnInit(): void {
  }

  doUnameChange() {
    console.log(this.uname)
  }

  doUpwdChange() {
    console.log(this.upwd)
    if (this.upwd.length < 6) {
      this.msg = "密码太短了"
    } else if (this.upwd.length > 12) {
      this.msg = "密码太长了"
    } else {
      this.msg = "密码合法"
    }
  }
}
